
DATABASE = {
    "default": {
        "host": "124.221.108.184",
        "port": 3306,
        "user": "root",
        "password": "qweasdzxc",
        "database": "aiooo",
        "max_connection": 20
    }
}

REDIS = {
    "default": {
        "host": "124.221.108.184",
        "port": 6379,
        "db": 9,
        "password": "qweasdzxc"
    }
}

LOG = {
    "log_path": "logs",
    "log_level": "DEBUG"
}

STATIC = {
    "static_root": "static"
}


JWT = {
    "tenant_secret": "2N5T6oT91H2OVxhc7BKwMcFFPd6aPHkp",
    "admin_secret": "AqGqFjyPB1aEdf9kSqvMU7F2VfLN75OS",
    "client_secret": "6mL1okdxGt58COcGfgKb12zhygYQyqs9",
    "algorithms": "HS256",
    "timeout": 7 * 24 * 60 * 60
}
RABBITMQ_CONFIG = {
    "username": "guest",
    "password": "guest",
    "host": "localhost",
    "vhost": "aiooo"
}

ES_CONFIG = {
    "hosts": ["http://localhost:9200"]
}

# 64位ID的划分
ID_WORKER_WORKER_ID_BITS = 7
ID_WORKER_DATACENTER_ID_BITS = 3
ID_WORKER_SEQUENCE_BITS = 12
# 最大取值计算
ID_WORKER_MAX_WORKER_ID = -1 ^ (-1 << ID_WORKER_WORKER_ID_BITS)  # 1-7
ID_WORKER_MAX_DATACENTER_ID = -1 ^ (-1 << ID_WORKER_DATACENTER_ID_BITS)  # 1-127
# 移位偏移计算
ID_WORKER_WOKER_ID_SHIFT = ID_WORKER_SEQUENCE_BITS
ID_WORKER_DATACENTER_ID_SHIFT = ID_WORKER_SEQUENCE_BITS + ID_WORKER_WORKER_ID_BITS
ID_WORKER_TIMESTAMP_LEFT_SHIFT = ID_WORKER_SEQUENCE_BITS + ID_WORKER_WORKER_ID_BITS + ID_WORKER_DATACENTER_ID_BITS
# 序号循环掩码
ID_WORKER_SEQUENCE_MASK = -1 ^ (-1 << ID_WORKER_SEQUENCE_BITS)
ID_WORKER_STARTTIMESTAMP = 1669791751872
